// Copyright 2012-present OSBI Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

form {
  margin: 0 0 30px 0;

  @include susy-clearfix();
}

label {
  display: block;
  margin: 0 0 7px 0;
  cursor: pointer;
}

.form-control {
  box-sizing: border-box;
  width: 100%;
  height: 36px;
  padding: 0 16px;
  line-height: 36px;
  color: $color-font;
  border: 1px solid rgba(#000, 0.08);
  background-color: #fff;
  box-shadow: inset 0 1px 2px rgba(#000, 0.06);

  &:focus {
    outline: 0;
  }
}

.form-group {
  margin: 0 0 15px 0;

  @include susy-clearfix();

  &.form-group-description {
    padding: 6px 0;
    line-height: 24px;
  }

  @media (min-width: $media-md) {
    .form-inline & {
      float: left;

      @include span(3 of 12);
    }

    &.form-group-description {
      @include span(6 of 12);
    }
  }

  &:last-child {
    margin-bottom: 0;
  }

  &.inline {
    display: flex;
    flex-direction: row;
    align-items: center;

    label {
      width: 120px;
      margin: 0 15px 0 0;
    }

    .input {
      flex-grow: 1;
    }
  }

  small {
    display: block;
    margin: 10px 0 0 0;
    padding: 12px 16px;
    font-size: 13px;
    line-height: 1.5;
    color: rgba($color-font, 0.6);
    background-color: rgba(#000, 0.03);
  }
}

fieldset {
  padding: 20px;
  border: 1px solid rgba(#000, 0.08);

  legend {
    float: left;
    width: 100%;
    margin: 0 0 20px 0;
    padding: 0 0 20px 0;
    font-weight: 500;
    border-bottom: 1px solid rgba(#000, 0.08);
  }
}

.form-check {
  input {
    margin: 0 10px 0 0;
  }
}

.form-group-button-description {
  float: left;
  line-height: 36px;

  a {
    text-decoration: underline;
  }
}

.form-description {
  padding: 30px;
  border: 1px solid rgba(#000, 0.06);

  .button-block {
    &:last-child {
      margin-bottom: 0;
    }
  }
}
